Skip to contentSkip to conversation

Split Access Problems

LARTC Mike Taekema 2 participants 2 messages Oct 16, 2003 – Oct 17, 2003

lore
Share & tools
lore
#0 lore raw

Good day,

I've searched through the mailman lists and no one seems to have had my problem yet. Here goes:

I've wrote a script that goes through and creates the split access steps. However I have changed somethings.

I've declared all my variables at the top of the shell script.

I only have one physical external ip address. So i created a virtual addess at eth0:0

My first problem is when I run the line: ip route add $P1_NET dev $IF1 src $IP1 table T1

I get the error: Error: argument "T1" is wrong: "table" value is invalid

For reference sake here is my script:

IF1=eth0
IF2=eth0:0
IP1=10.123.124.52
IP2=10.123.124.53
P1=10.123.124.253
P2=10.123.124.251
P1_NET=10.123.124.0/24
P2_NET=10.123.124.0/24

# Now lets add routes to two separate tables (T1, T2). This just tidy's things up a bit.

ip route add $P1_NET dev $IF1 src $IP1 table T1 ip route add default via $P1 table T1
ip route add $P2_NET dev $IF2 src $IP2 table T2 ip route add default via $P2 table T2

# Now we setup our main routing table.

ip route add $P1_NET dev $IF1 src $IP1 ip route add $P2_NET dev $IF2 src $IP2

# Now we prefrence our default route

ip route add default via $P1

# Next, setup the routing rules. These choose what routing table to route with. Make sure you

# route out a given interface if you already have the corresponding address.

ip rule add from $IP1 table T1
ip rule add from $IP2 table T2

exit 0

Intelligent Digital Security.

Mike Taekema [email protected] www.netmaster.com

Page Me!

#1 lore raw
Quoted 3 lines

Mike Taekema wrote:

Good day,

Please do not post in html format.

Quoted 2 lines

My first problem is when I run the line: ip route add $P1_NET dev $IF1 src $IP1 table T1

You have not edited /etc/iproute2/rt_tables. For reference, here's mine( minus the comments):

	255	local
	254	main
	253	default
	0	unspec
	2	eth1
	4	eth2
	6	eth3
	8	ppp0
	9	mpath

and I specify these as "eth2", Etc. Where your above is T1, I use $IFE1 and IFE1="eth1" appears in my definitions at the top of the script.

Quoted 2 lines

I get the error: Error: argument "T1" is wrong: "table" value is invalid

Gypsy
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/